// 导入less
require("../css/badge.less")
// 引入fonts
require('../fonts/iconfont.css');
document.ready(function () {
    // 取出本地存储的数据（用户的id）
    const userId = window.localStorage.getItem("userId");
    // 获取元素节点
    const iconBack = document.querySelector("#iconBack")
    const iconBacks = document.querySelector("#iconBacks")
    const rank = document.querySelector("#rank") //排名
    const mybadge = document.querySelector("#mybadge") //徽章按钮
    const badgeMask = document.querySelector("#badgeMask") //蒙层
    // 返回按钮
    iconBack.addEventListener("click", function () {
        window.history.back()
    })
    // 排名
    window.$http.get(`headPageInfo?userId=${userId}`, function (res) {
        if (res.status === 0) {
            const ranks = res.data.rank; //排名
            rank.textContent = ranks
        }
    })
    mybadge.addEventListener("click", function () {
        badgeMask.style.display = "block"
    })
    // 蒙层
    iconBacks.addEventListener("click", function () {
        badgeMask.style.display = "none"
    })
})